package net.csdra.DongPoShuZiTuShuGuan;

import net.csdra.adapter.filestorage.FileStorageAdapter;
import net.csdra.adapter.filestorage.FileStorageAdapterImpl;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
public class DongPoShuZiTuShuGuanApplication {

    public static void main(String[] args) {
        SpringApplication.run(DongPoShuZiTuShuGuanApplication.class, args);
    }


    @Bean
    FileStorageAdapter fileStorageAdapter(@Value("${file.baseDir}") String baseDir, @Value("${file.tmpDir}") String tmpDir, @Value("${file.salt}") String salt, @Value("${file.limitLength}") long limitLength) {
        return new FileStorageAdapterImpl(baseDir, tmpDir, salt, limitLength);
    }

    @Bean
    String videoUrl(@Value("${defualt.videoUrl}") String videoUrl) {
        return videoUrl;
    }

    @Bean
    String videoName(@Value("${defualt.videoName}") String videoName) {
        return videoName;
    }

    @Bean
    String videoInfo(@Value("${defualt.videoInfo}") String videoInfo) {
        return videoInfo;
    }
}
